﻿@Html.StatusMessage()
@using (Html.BeginAjaxForm("_BatchRemoveOperation", "ControlPanelSettings", null, FormMethod.Post, new AjaxFormOptions { OnSuccessCallBack = "OnSuccessCallBack", OnErrorCallBack = "OnErrorCallBack" }, new { id = "BatchRemoveNavigation" }))
{
    <div class="tnc-dailog-pd">
        <div class="tn-form">
            <div class="tn-form-row">
                <strong>确认批量删除选中的快捷操作？</strong>
            </div>
            <div class="tn-form-row">
                <label class="tn-form-label"> 
                    @Html.SipmleCheckBox("forceOwnerDelete", false)
                    @Html.Hidden("operationIds", false)
                    强制删除
                </label>
            </div>
            <div class="tn-form-row">
                <span>选中后会同时删除用户、商户相关快捷操作</span>
            </div>
            <div class="tn-form-row tn-form-row-button">
                @Html.Button("确定", ButtonTypes.Submit, HighlightStyles.Primary)
                @Html.Button("取消", ButtonTypes.Cancel, HighlightStyles.Secondary, htmlAttributes: new { dialogOperation = "close" })
            </div>
        </div>
    </div>
}
<script type="text/dialog">
    
      this.title("消息");
    
</script>
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        $("input[name='forceOwnerDelete']").click(function () {
            if ($(this).attr("checked")) {
                $(this).attr("value", true);
            } else {
                $(this).attr("value", false);
            }
        });

        var navIds = '';
        $("input[id^='operationIds-']:checked").each(function () {
            operIds += $(this).val() + ',';
        });


        $('#operationIds').val(operIds);
    });

    function OnSuccessCallBack(data) {
        art.dialog.tips(data.MessageContent, 1.5, data.MessageType,
            function () {
                window.location.reload(true);
            })
    }
</script>
